Infrared detection system and method with histogram based manual level and gain control with local gain clipping

ABSTRACT

A system and method for processing digital video. The invention allows for manual level and gain adjustment of the video similar to that used in a histogram based automatic level and gain control system using a cumulative distribution function. Level changes are made by an offset to the existing automatic level and gain. Level changes are first made by applying an offset L and the midscale gray intensity bin on the histogram is located. Gain changes are made by changing the relative gain multiplier (G) which acts on the automatic level and gain algorithm causing the gain to change equally about midscale gray (i.e., midscale gray is maintained). In accordance with the invention, as part of the histogram based manual level and gain algorithm, the local gain is clipped to a predetermined maximum in order to prevent an overly noisy picture when too much gain is applied. The inventive method determines how to prevent a shift in the level when increasing the gain (i.e., G&gt;1) even when clipping is applied. An anti-saturation algorithm is also applied to prevent saturation from affecting the video too drastically. In order to provide the ability to change the picture from black to white an offset is required under low gain. Lastly, the inventive method allows for fine and coarse adjustments and includes histogram equalization, polarity reversal and gamma correction.

BACKGROUND OF THE INVENTION

[0001] 1. Field of the Invention

[0002] The present invention relates to infrared detection systems. Morespecifically, the present invention relates to systems and methods forproviding automatic gain and level control in infrared detectionsystems.

[0003] 2. Description of the Related Art

[0004] Forward looking infrared (FLIR) based imaging systems are widelyused to view targets and other objects in darkness and other conditions(smoke, haze, etc.) which might otherwise obscure visible detection. Asit is often difficult to discriminate targets from background using aninfrared imaging system, systems and methods have been developed foroptimizing level and gain adjustments to enhance target detectability ofIR imagers.

[0005] Many algorithms are known in the art for providing automatic gainand level control for infrared imaging systems. Unfortunately, thesesystems generally provide no manual adjustment capability. Those thatprovide manual level and gain control tend to change the picturedrastically. This can cause confusion which, in certain (i.e. military)applications, can lead to serious adverse consequences. The dramaticchange in the image is due to the fact that in automatic mode, outputimage intensity is related to detected energy in accordance with anonlinear relationship using a histogram approach; whereas, in manualmode, output image intensity is related to detected energy in accordancewith a linear relationship.

[0006] Hence, a need exists in the art for a system or method forimproving the performance of infrared imaging displays. Moreparticularly, a need remains in the art for a system or method forproviding manual gain and level adjustment of the output of an infraredimager which does not substantially alter the image relative to thatseen in an automatic gain and level adjustment mode thereof.

SUMMARY OF THE INVENTION

[0007] The need in the art is addressed by the system and method forproviding manual level and gain control of an imaging system of thepresent invention. In accordance with the inventive method a pluralityof signals are received from a detector representative of a scene. Next,a histogram of the scene is created. The histogram includes a number ofintensity bins and an indication of the number of pixels in each. Thehistogram is transformed in accordance with a first function whichdefines how the histogram affects a display of the signals. The methodallows for one to set a limit with respect to the first function. Themethod then determines a normalized cumulative distribution function ofthe transformed histogram within the limit on localized gain. Finally,the method is adapted to receive gain factor and level input from anoperator and define a histogram controlled second function to assignvalues for each bin in accordance therewith and in accordance with thenormalized cumulative distribution function.

[0008] In a specific implementation, the method further includes thesteps of ascertaining a midscale gray bin for the level shiftedtransformed histogram and determining a clipped, level shiftednormalized cumulative distribution function which maintains midscalegray of the midscale gray bin. In the illustrative embodiment, the stepof receiving gain factor and level input further includes the step ofdetermining a normalized cumulative distribution function for each bin.A gray shade is assigned for each bin in accordance with the secondfunction. The inventive method further includes the steps of adjustingthe polarity of each bin and effecting a gamma correction on each pixelin each bin.

[0009] In an illustrative application, the inventive system and methodare used in the processing of digital video. The present inventionallows for manual level and gain (MLG) adjustment of the video similarto that used in a histogram based automatic level and gain (ALG) controlsystem using a cumulative distribution function (cdf) which is the areaunder the histogram. Level changes are made by an offset (L) to theexisting ALG level (median) and gain changes are made by changing therelative gain multiplier (G) which acts on the ALG algorithm causing thegain to change equally about the median. ALG is thus a subset of thehistogram based MLG in which G=1 and L=0. In accordance with theinvention, as part of the histogram based MLG algorithm, the local gainis clipped to a predetermined maximum in order to prevent an overlynoisy picture when too much gain is applied. The inventive methoddetermines how to prevent a shift in the level when increasing the gain(i.e., G>1) even when clipping is applied. An anti-saturation algorithm(histogram end bins are clipped) is also applied to prevent saturationfrom affecting the video too drastically. In order to provide theability to change the picture from black to white an offset is requiredunder low gain. Lastly, the inventive method allows for fine and coarseadjustments, and also includes histogram equalization (part of the firstfunction), polarity reversal and gamma correction.

BRIEF DESCRIPTION OF THE DRAWINGS

[0010]FIG. 1 is a system level block diagram of a gimbaled forwardlooking infrared imaging system with associated system electronics inaccordance with the teachings of the present invention.

[0011]FIG. 2 is a flow diagram illustrating the operation of the systemof FIG. 1 in connection with the detection of mid wave infrared images.

[0012]FIG. 2a is a diagram of a typical histogram generated in thedetection of infrared imagery.

[0013]FIG. 3 is a flow diagram of a typical conventional method forproviding automatic level and gain control for an infrared imagingsystem.

[0014]FIG. 4 is a flow diagram of a typical conventional method forproviding manual level and gain control for an infrared imaging system.

[0015]FIG. 5 is a flow diagram of an improved method for providingmanual level and gain control in an infrared imaging system inaccordance with the teachings of the present invention.

[0016]FIG. 6 is a flow diagram of the inventive method for clippingimplemented in the method depicted in FIG. 5.

DESCRIPTION OF THE INVENTION

[0017] Illustrative embodiments and exemplary applications will now bedescribed with reference to the accompanying drawings to disclose theadvantageous teachings of the present invention.

[0018] While the present invention is described herein with reference toillustrative embodiments for particular applications, it should beunderstood that the invention is not limited thereto. Those havingordinary skill in the art and access to the teachings provided hereinwill recognize additional modifications, applications, and embodimentswithin the scope thereof and additional fields in which the presentinvention would be of significant utility.

[0019]FIG. 1 is a system level block diagram of a gimbaled forwardlooking infrared imaging system with associated electronics inaccordance with the teachings of the present invention. The IR imagingsubsystem 100 includes a sensor 200, electronics 500, controls 300 and adisplay 400. The sensor 200 includes optics 210 and, in the illustrativeembodiment, an infrared staring detective assembly 220. Input imageryfrom a scene is received by the optics 210 and provided to the infraredstaring detective assembly 220. The image is sampled and output tosystem electronics 500 as analog FLIR video.

[0020] The system electronics unit 500 includes a Video Processor 520and uniformity correction electronics which includes DNUC (DigitalNon-Uniformity Correction) 510 and SBNUC (Scene Based Non-UniformityCorrection) 512. The analog FLIR video is converted to a digital signalin the DNUC 510 and the DNUC 510 and SBNUC 512 apply digital uniformitycorrections to each pixel. The resulting digital signal is sent to theVideo Processor 520 where the digital video is converted to RS-170 videofor the Display 400. Changes to gain and level, polarity, gammacorrection and mode (ALG vs. MLG, histogram equalization function) aremade using aircraft controls 300 and sent via 1553 communication to thePod Controller 580. The Pod Controller sends the final gain and levelvalues, polarity (black hot or white hot), gamma correction constants (γand λ) and mode to the Video Processor 520.

[0021]FIG. 2 is a flow diagram illustrating the operation of the systemof FIG. 1 in connection with the detection of mid wave infrared images.As shown in FIG. 2, the method 600 includes the step 610 of illuminatinga detector array with input imagery. At step 620, the detector outputsanalog multiplexed signals of the scene. These signals are digitized andcorrected for nonuniformities at step 630 by the DNUC 510 and SBNUC 512.At step 640, the video processor 520 creates a histogram of the scene.An example of a histogram is depicted in FIG. 2a.

[0022]FIG. 2a is a diagram of a typical histogram generated in thedetection of infrared imagery. The histogram 670 provides a number ofintensity bins 672 (bin 3582), 674 (bin 3583), etc. (the intensity binsin a 14-bit histogram actually range from 0 to 16383=2¹⁴−1 but the plot670 zooms in on the range of interest so that individual occupied binscan be made out). The height of each bin is determined by the number ofpixels of the detector which output energy at the intensity levelassociated therewith.

[0023] Returning to FIG. 2, at step 650, the video processor 520 assignsshades of gray to each histogram bin depending on the mode of operation.That is, the video processor 520 assigns shades of gray in accordancewith an automatic level and gain control algorithm (ALG) or a manuallevel and gain control mechanism (MLG). As discussed more fully below,in accordance with the present teachings, a manual level and gaincontrol system and method are provided which ensure identical outputimage between the automatic control mode and manual control mode whenthere is no shift in gain or level. The teachings of the presentinvention are best appreciated after a review and consideration ofconventional ALG and MLG modes of operation.

[0024]FIG. 3 is a flow diagram of a typical conventional method forproviding automatic level and gain control for an infrared imagingsystem. As shown in FIG. 3, the conventional ALG method 700 includes thesteps 710 of creating a histogram. Step 710 implements the step 640 ofthe FIG. 2 where:

h(i)=# pixels at intensity bin “i”  [1]

[0025] where 0≦i≦MaxI

[0026] Next, at step 720, the method 700 defines how the histogramaffects video. A transformed histogram is created:

trans_hist(i)=f(h(i))  [2]

[0027] where function f(x) is defined for each equalization mode andaffects localized gain. In 720, local gain at bin “i” is defined as#gray shades/bin at bin “i” and is proportional to trans_hist(i). Formost cases (for common functions f(x) used in transforming thehistogram, like root equalization where f(x)=x^ 0.5), increasing theoccupancy of the bin will increase the localized gain at that bin.

[0028] Next, at step 730, the method 700 optionally optimizes the datawith antisaturation and clipping algorithms. When saturation occurs in alarge area of the video, the part of the video not saturated would havelow contrast and would be too dark if in white hot. Antisaturationreduces these undesirable effects. Antisaturation is effected byrecalculating the cumulative distribution function (cdf(MaxI)) when theends are eliminated as follows:

antisaturation−trans_hist(i)=0  [3]

[0029] at i=0, i=MaxI

[0030] Clipping prevents the localized gain from being too high. If thelocalized gain is too high, the video appears too noisy. Hence, in step730 clipping−trans_hist(i) is limited to a specified value and theclipped bins are redistributed.

[0031] At step 740, the method 700 defines a function Y(i) to assigngray shades for each bin. First, the cumulative distribution function isfound as the forward sum of transformed histogram: $\begin{matrix}{{{cdf}(i)} = {\sum\limits_{j = 0}^{i}{t\quad r\quad a\quad n\quad s\quad \_ \quad h\quad i\quad s\quad {t(j)}}}} & \lbrack 4\rbrack\end{matrix}$

[0032] Next, this function is normalized to create Y(i):

Y(i)=norm*cdf(i)  [5]

norm=MaxY/cdf(MaxI)  [6]

[0033] where: 0≦Y(i)≦MaxY and ‘MaxY’ is maximum value in the gamma_lut(gamma look up table) domain (on typical systems MaxY has been4095=2¹²−1 for 12-bit or 16383=2¹⁴−1 for 14-bit).

[0034] Next, at step 750, the polarity of the function is adjusted:

If white hot: then Y(i) is unchanged  [7]

If black Hot: then Y(i)=MaxY−Y(i)  [8]

[0035] Finally, at step 760, the final assignment of gray shades foreach bin video_lut(i) is effected via gamma correction:

video_lut(i)=gamma_lut(Y(i))  [9]

[0036] For 8-bit analog video:

gamma_lut(i)=255*((lambda^((−1/MaxY))−1)/(1/lambda−1)]^(gamma)  [10]

[0037] where lambda (0<lambda<1) and gamma (0<gamma<2) are a function ofthe display. Gamma correction is a well-known technique for making upfor the human eye and imperfect displays by producing video which appearto linearly change with Y(i).

[0038]FIG. 4 is a flow diagram of a typical conventional method forproviding manual level and gain control for an infrared imaging system.As shown in FIG. 4, the conventional MLG method 800 includes the steps810 of creating a histogram. Step 810 implements the step 640 of theFIG. 2.

[0039] Next, at step 820, a function is defined using a histogram toupdate the level of the signals and define an initial gain value bycreating a cumulative distribution function equal to the forward sum ofthe histogram (i.e., the area under the histogram curve):$\begin{matrix}{{{cdf}(i)} = {\sum\limits_{j = 0}^{i}{h(j)}}} & \lbrack 11\rbrack\end{matrix}$

[0040] wherein h(j) is the histogram of the scene as a function ofintensity bin j.

[0041] Initial gain and level must be determined when transitioning fromALG to MLG. At step 830, an initial level is defined and the gain is setbased on the cdf endpoints: 1) Initial level L=midI; 2) Initial gain Gis based on the cdf endpoints:

G=(high%−low%)*255/(highI−lowI)  [12]

[0042] where ‘midI’ is equal to MaxI/2; ‘G’ is the gain and is the slopeof the line established by the 2 endpoints, ‘high%’ establishes the highendpoint of the cdf and may be chosen by the designer from 60% to 100%;‘low%’ establishes the low endpoint of the cdf and is 100%-high%;‘highI’ is the bin corresponding to a cdf which is a fraction(fraction=high%/100%) of the maximum cdf value (i.e., cdf(highI)=$\left( {{i.e.},{{{cdf}\left( {{high}I} \right)} = {{\sum\limits_{j = 0}^{highI}{h(j)}} = {\left( {{high}\quad \% \quad 100\quad \%} \right)*{{cdf}\left( {{Max}\quad I} \right)}}}}} \right);$

[0043] =(high%/100%)*cdf(MaxI)); and ‘lowI’ is the bin corresponding toa cdf which is a fraction (fraction=low%/100%) of the maximum cdf value(i.e., cdf(lowI)=$\left( {{i.e.},{{{cdf}\left( {{low}I} \right)} = {{\sum\limits_{j = 0}^{lowI}{h(j)}} = {\left( {{low}\quad \% \quad 100\quad \%} \right)*{{cdf}\left( {{Max}\quad I} \right)}}}}} \right).$

[0044] =(low%/100%)*cdf(MaxI)).

[0045] As an example calculation for the method of finding initial gainif endpoints are established based on low%=10% and high%=90%:$\begin{matrix}{{c\quad u\quad m} = {{{cdf}\left( {{Max}\quad I} \right)} = {\sum\limits_{j = 0}^{{Max}\quad I}{h(j)}}}} & \lbrack 13\rbrack\end{matrix}$

[0046] Since cum should not change over time, the value of cum may beestablished at power-up initialization.

G=(0.9−0.1)*MaxY/(highI−lowI)  [14]

[0047] where highI=90% cdf point=bin such that initial cdf(highI)=${{high}I} = {{90\% \quad c\quad {df}\quad {point}} = {{{bin}\quad {such}\quad {that}\quad {initial}\quad {{cdf}\left( {{high}I} \right)}} = {{\sum\limits_{j = 0}^{highI}{h(j)}} = {0.9*c\quad u\quad m}}}}$

[0048] =0.9*cum and lowI=10% cdf point=bin such that initial cdf(lowI)=${{low}I} = {{10\% \quad c\quad {df}\quad {point}} = {{{bin}\quad {such}\quad {that}\quad {initial}\quad {{cdf}\left( {{low}I} \right)}} = {{\sum\limits_{j = 0}^{lowI}{h(j)}} = {0.1*c\quad u\quad {m.}}}}}$

[0049] =0.1*cum.

[0050] Next, at step 840, a linear function is defined to assign a grayshade to each bin with a gain and level under operator control. Thelevel is adjusted relative to the median (this auto-level feature isreferred to as auto-assist):

Y(i)=G*[i−(median+L−midI)]+MaxY/2  [15]

[0051] where 0≦Y(i)≦MaxY. The conventional method 800 only updates basedon median changes and operator gain/level changes. The levelautomatically adjusts relative to the median (auto-assist), while gainchanges are made relative to the initial gain. The median is 50% cdfpoint or:

[0052] median is the bin in which: $\begin{matrix}{{{cdf}\left( {m\quad e\quad d\quad i\quad a\quad n} \right)} = {{\sum\limits_{j = 0}^{m\quad e\quad d\quad i\quad a\quad n}{h(j)}} = {0.5*c\quad u\quad m}}} & \lbrack 16\rbrack\end{matrix}$

[0053] Finally, at steps 850 and 860, polarity adjustment and gammacorrection, respectively, are performed as per the ALG mode depicted inFIG. 3.

[0054]FIG. 5 is a flow diagram of an improved method for providingmanual level and gain control in an infrared imaging system inaccordance with the teachings of the present invention. The inventivemethod 900 includes the steps of creating the histogram (910) anddefining how the histogram affects video (920) which are implemented inthe same manner as steps 710 and 720 of the method 700 of FIG. 3 andsteps 810 and 820 of FIG. 4.

[0055] At step 930, antisaturation and clipping are performed in amanner similar to that of step 730 of the method 700 of FIG. 3 with theexception that, as discussed more fully below, clipping is applied afterthe gain change is made thereby preventing the operator from obtainingan excessively noisy and unusable video:

[0056] 1) antisaturation eliminates the ends as follows:

[0057] recalculate cdf(Max I):

[0058] new cdf(MaxI)=old cdf(MaxI)−trans_hist(0)−trans_hist(MaxI)eliminate contributions of both ends:

trans_hist(i)=0 at i=0, i=MaxI  [17]

[0059] 2) clipping applied after applying gain as follows:

[0060] Apply Gain and normalize:

hist_clip(i)=G*norm*trans_hist(i)  [18]

[0061] Clip by not exceeding max_occ:

[0062] If hist_clip(i)>max_occ then hist_clip(i)=max_occ cdf_clip(i) &midlevel are then determined (details are provided later).

[0063] At step 940, a histogram controlled function (as opposed to thelinear controlled function of the method 800 of the prior art) isdefined to assign a gray shade to each bin with a gain and level underoperator control:

[0064] 1) determine normalized cdf(i):

if clip: cdf(i)=cdf_clip(i)/G  [19]

[0065] where 0<i<MaxI

[0066] 2) determine Y(i):

Y(i)=G*(cdf(i)−midlevel)+MaxY/2+(G<1)*(1−G)*L/2  [20]

[0067] where 0≦Y(i)≦MaxY.

[0068] The inventive method was designed with the assumption that thepilot would adjust the level of the desired target to midscale gray andthen boost the gain to increase contrast within the target withoutchanging the average level of the target. The added term (G<1)*(1−G)*L/2is required in order to allow the level to achieve the extremes of blackor white video when gain is reduced below 1.

[0069] Gain (G) and level (L) are changed by the operator as follows:

G=MLG_A*MLG_B^(mlg) ^(_(—)) ^(gain)  [21]

[0070] where MLG_A=minimum gain and MLG_B determines rate of change of Gwhen operator changes mlg_gain (assuming mlg_gain varies from 0 toMax_mlg_gain). In ALG mode, G=1 so initial value ofmlg_gain=−Log(MLG_A)/Log(MLG_B).

L=(mlg_level−Max_mlg_level/2)*MaxY/Max_mlg_level  [22]

[0071] Assuming mlg_level varies from 0 to Max_mlg_level. The mlg_levelis input by the operator and initially equals Max_mlg_level/2 when inALG (resulting in L=0).

[0072] Finally, at steps 950 and 960, polarity adjustment and gammacorrection, respectively, are performed as per the ALG mode depicted inFIG. 3.

[0073]FIG. 6 is a flow diagram of the inventive method for clippingimplemented in the step 930 of the method 900 of FIG. 5. The inventiveclipping method 1000 includes the step 1010 of establishing the degreeof clipping based on establishing the minimum desired dynamic range(minimum dynamic range corresponds to maximum gain). Here, the limit onlocalized gain is set based on max_occ:

max_occ=MaxY/min_bins  [23]

[0074] where min_bins establishes the minimum number of bins in whichthe video will spread over the full dynamic range from black to white(or a maximum of 1/min_bins of the dynamic range is spread over 1 bin).

[0075] Next, at step 1020, the clipped normalized cumulativedistribution function with gain applied is found:

[0076] 1) Find hist_clip(i) and limit hist_clip(i) to max_occ:

[0077] Find hist_clip(i) by normalizing and applying Gain (same as[18]):

hist_clip(i)=G*norm*trans_hist(i)  [24]

[0078] Clip by not exceeding max_occ:

[0079] If hist_clip(i)>max_occ then hist_clip(i)=max_occ

[0080] 2) Determine cdf_clip(i): $\begin{matrix}{{{cdf}\quad \_ \quad {{clip}(i)}} = {\sum\limits_{j = 0}^{i}{h\quad i\quad s\quad t\quad {\_ clip}(j)}}} & \lbrack 25\rbrack\end{matrix}$

[0081] Here, clipped cdf is equivalent to clipped Y(i) for ALG exceptgain is applied. The formula for “norm” is same as in equation [6].

[0082] Next, at step 1030, a midscale gray bin for unclipped, levelshifted ALG is found:

cdf(median)=MaxY/2−L  [26]

[0083] Here, the cdf is the same as Y(i) for unclipped, level shiftedALG, i.e.: $\begin{matrix}{{{cdf}(i)} = {{n\quad o\quad r\quad m*{\sum\limits_{j = 0}^{i}{t\quad r\quad a\quad n\quad s\quad \_ \quad h\quad i\quad s\quad {t(j)}}}} + L}} & \lbrack 27\rbrack\end{matrix}$

[0084] The median is calculated as the bin where:

cdf(median)=MaxY/2=midscale Y value  [28]

[0085] Using the cdf just defined and plugging in i=median yields:$\begin{matrix}{{n\quad o\quad r\quad m*{\sum\limits_{j = 0}^{m\quad e\quad d\quad i\quad a\quad n}{t\quad r\quad a\quad n\quad s\quad \_ \quad h\quad i\quad s\quad {t(j)}}}} = {{{Max}\quad {Y/2}} - L}} & \lbrack 29\rbrack\end{matrix}$

[0086] This relationship is used below.

[0087] At step 1040, the clipped normalized cdf at the median (midscalegray bin) is found by finding the value of Midlevel:

Midlevel=cdf_clip(median)/G  [30]

[0088] unless median doesn't exist.

[0089] In step 1040, the “midlevel” is establishing the clipped andnormalized cdf value at the same median which was established for G=1and no clipping (i.e., finding midscale gray for 940 so that gain andclipping do not change the median from the unclipped, ALG median value).In other words,

midlevel=cdf_clip(median)/G  [31]

[0090] For cases where the median does not exist because of a largelevel shift, an alternative formulation is required and is derived asfollows:

midlevel=cdf_clip(median)/G  [32] $\begin{matrix}{{m\quad i\quad d\quad l\quad e\quad v\quad e\quad l} = {{n\quad o\quad r\quad m*{\sum\limits_{j = 0}^{m\quad e\quad d\quad i\quad a\quad n}{t\quad r\quad a\quad n\quad s\quad \_ \quad h\quad i\quad s\quad {t(j)}}}} + {{clipped\_ bins}{\_ before}{\_ median}}}} & \lbrack 33\rbrack\end{matrix}$

[0091] Note that equation [33] is based on the definition of clipping.

[0092] Plugging in relationship shown in equation [29] yields:

midlevel=MaxY/2−L+clipped_bins_before_median  [34]

[0093] For L>MaxY/2, by [26] midlevel is negative which means the median(which really can't exist because Y(i) is always greater than 0) intheory occurs before the first bin so clipping has not occurred yet andclipped_bins_before_median is 0; so, midlevel=MaxY/2−L.

[0094] For L<−MaxY/2, by [26] midlevel is greater than MaxY which meansthe median (which really can't exist because Y(i) is always less thanMaxY) in theory occurs after the last bin and clipping has beencompleted with clipped_bins_before_median equal toMaxY−cdf_clip(MaxI)/G; so, midlevel=cdf_clip(MaxI)−MaxY/2−L.

[0095] Then, at step 1050, the value of cdf_clip(i) and midlevel arepassed to step 940 of FIG. 5.

[0096] In short, the novel clipping method differs from the conventionalclipping method in that clipping occurs after the gain has been appliedand the clipped bins are not redistributed (i.e., instead ofredistributing clipped bins, the goal is to maintain midscale gray afterincreasing gain which is why midlevel is found).

[0097] Finally, returning to FIG. 2, at step 660, the video processor520 of FIG. 1 digitally converts the intensity of each pixel into ashade of gray and outputs the data in an analog television displayformat (RS-170).

[0098] The level and gain adjustments are user friendly in the sensethat changing level and gain from the ALG video is immediate and gradualwhen using fine adjust and fast when using coarse adjust. As required bythe pilot, one would first want to make a coarse level change to viewthe target (which is a subset of the histogram and intensity of thetarget's pixels are usually near the ends of the histogram where thevideo is black or white in ALG) at midscale gray and then use a coarsegain increase to provide contrast enhancement of the target. Then a finelevel adjust may be necessary before making the last fine gain increase.

[0099] The only known histogram based operator controllable algorithmused previously was called ALG2 (ALG2 was implemented on NAVFLIR about10 years ago). ALG2 did not have local gain clipping or anti-saturationalgorithms. In addition, the level and gain adjustments were made in anon-user friendly fashion. Gain was determined by the window size (areaof detector's dynamic range chosen) and the level was set as the centerof the window. The problem with this algorithm was that the window wasinitially centered in the center of the detector's dynamic range therebyignoring where the median (midscale gray bin) was located. One had toincrease gain first before one knew how to change the level. Smallchanges to the gain or level may not change the picture at all if theentire histogram covered only a small portion of the detector's dynamicrange and was located near the center of the dynamic range. In short,ALG2 is not user friendly because one does not know which way to adjustlevel by just looking at the picture, i.e., one has to search for theright level after increasing the gain.

[0100] The other prior art described in FIG. 4 is a typical linear MLGalgorithm which assumes a linear relationship with the detector output;therefore, the linear MLG algorithm fails to provide higher local gainwhere the scene dominates thereby providing a washed-up picture unlikethe histogram based MLG or ALG algorithms. Switching to a linear basedMLG algorithm from a histogram based ALG algorithm results in a majorchange to the video. With the histogram based MLG algorithm, there is nochange to the video when switching from the histogram based ALG video.Because the ATFLIR is DC coupled as most staring FLIRs, the averagevideo level will change dramatically as a function of scene and opticstemperature changes. In the linear manual mode without auto-assist itwill take significant operator work load to keep up with these changesunlike the histogram based MLG algorithm of the present invention. Evenwith auto-assist, significant changes in the scene (like transitioningfrom a ground scene to a combination of sky and ground) would result inthe target saturating black or white because the gain is notautomatically updating (the auto-assist MLG algorithm fixes the gain ontransition from ALG to MLG).

[0101] As part of the histogram based MLG algorithm, the local gain isclipped to a predetermined maximum in order to prevent an overly noisypicture when too much gain is applied. In theory, the clipping algorithmcan actually improve the MRT performance by reducing the noise of thebackground.

[0102] Lastly, an anti-saturation algorithm (histogram end bins areclipped) is applied to prevent saturation from affecting the video toodrastically (large amounts of white saturation will cause thenonsaturated portions of the video to darken excessively).Antisaturation is especially important for MWIR FLIRs where sun glintmay be a problem. The local gain-clipping algorithm will also helpreduce saturation affects by clipping histogram bins close to the ends.

[0103] Thus, the present invention has been described herein withreference to a particular embodiment for a particular application. Thosehaving ordinary skill in the art and access to the present teachingswill recognize additional modifications, applications and embodimentswithin the scope thereof.

[0104] It is therefore intended by the appended claims to cover any andall such applications, modifications and embodiments within the scope ofthe present invention.

[0105] Accordingly,

What is claimed is:
 1. A system for providing manual level and gaincontrol of an imaging system comprising: first means for receiving aplurality of signals from a detector representative of a scene; secondmeans for creating a histogram of said scene, said histogram including anumber of intensity bins and an indication of a number of pixels in saidsignals from said detector in each of said bins; third means fortransforming said histogram in accordance with a first function whichdefines how said histogram affects a display of said signals; fourthmeans for setting a limit with respect to said function; fifth means fordetermining a normalized cumulative distribution function of saidtransformed histogram within said limit on localized gain; and sixthmeans for receiving gain factor and level input from an operator anddefining a histogram controlled second function to assign values foreach bin in accordance therewith and in accordance with the output ofsaid fifth means.
 2. The invention of claim 1 wherein said means forclipping further includes means for ascertaining a midscale gray bin fortransformed histogram.
 3. The invention of claim 2 wherein said meansfor clipping further includes means for determining a clipped normalizedcumulative distribution function of said midscale gray bin.
 4. Theinvention of claim 3 wherein said sixth means includes means fordetermining a normalized cumulative distribution function for each bin.5. The invention of claim 4 further including means for assigning a grayshade for each bin in accordance with said second function.
 6. Theinvention of claim 5 further including means for adjusting a polarity ofeach bin.
 7. The invention of claim 6 further including means foreffecting a gamma correction on each pixel in each bin.
 8. A programstored on a computer readable medium for providing manual level and gaincontrol of an imaging system comprising: code for receiving a pluralityof signals from a detector representative of a scene; means foraccessing a histogram of said scene, said histogram including a numberof intensity bins and an indication of a number of pixels in saidsignals from said detector in each of said bins; code for transformingsaid histogram in accordance with a first function which defines howsaid histogram affects a display of said signals; code for setting alimit with respect to said function; code for determining a normalizedcumulative distribution function of said transformed histogram withinsaid limit on localized gain; and code for interpreting gain and levelchanges from an operator and defining a histogram controlled secondfunction to assign values for each bin in accordance therewith and inaccordance with the output of said fifth means.
 9. The invention ofclaim 8 wherein said code for clipping further includes code forascertaining a midscale gray bin for transformed histogram.
 10. Theinvention of claim 9 wherein said code for clipping further includescode for determining a clipped normalized cumulative distributionfunction of said midscale gray bin.
 11. The invention of claim 10wherein said code for receiving gain factor and level input includescode for determining a normalized cumulative distribution function foreach bin.
 12. The invention of claim 11 further including code forassigning a gray shade for each bin in accordance with said secondfunction.
 13. The invention of claim 12 further including code foradjusting a polarity of each bin.
 14. The invention of claim 13 furtherincluding code for effecting a gamma correction on each pixel in eachbin.
 15. A method for providing manual level and gain control of animaging system including the steps of: receiving a plurality of signalsfrom a detector representative of a scene; creating a histogram of saidscene, said histogram including a number of intensity bins and anindication of a number of pixels in said signals from said detector ineach of said bins; transforming said histogram in accordance with afirst function which defines how said histogram affects a display ofsaid signals; setting a limit with respect to said function; determininga normalized cumulative distribution function of said transformedhistogram within said limit on localized gain; and receiving gain factorand level input from an operator and defining a histogram controlledsecond function to assign values for each bin in accordance therewithand in accordance with the result of the determining step.
 16. Theinvention of claim 15 wherein the step of clipping further includes thestep of ascertaining a midscale gray bin for transformed histogram. 17.The invention of claim 16 wherein the step of clipping further includesthe step of determining a clipped normalized cumulative distributionfunction of said midscale gray bin.
 18. The invention of claim 17wherein the step of receiving gain factor and level input includes thestep of determining a normalized cumulative distribution function foreach bin.
 19. The invention of claim 18 further including the step ofassigning a gray shade for each bin in accordance with said secondfunction.
 20. The invention of claim 19 further including the step ofadjusting a polarity of each bin.
 21. The invention of claim 19 furtherincluding the step of effecting a gamma correction on each pixel in eachbin.